package com.ap.autobase.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
//import org.apache.log4j.spi.LoggerFactory;
//import org.slf4j.Logger;

@Controller
public class WelcomeController {

	/*@Autowired
	UserService userService;*/

	//private static final Logger logger = LoggerFactory();
	
	/*@RequestMapping(value = { "", "/" }, method = RequestMethod.GET)
	public String login() {
		return "login";
		
		public String welcome(HttpServletRequest request, HttpServletResponse response) {
        LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
        localeResolver.setLocale(request, response, StringUtils.parseLocaleString("fr"));
        return "my_page";
    }
	}*/
	
	
	@RequestMapping(value = { "", "/", "/welcome"}, method = RequestMethod.GET )
	public ModelAndView welcome(){//HttpServletRequest request, HttpServletResponse response){
		String[] str = {"ewq","qwe","abc","dek"};
		ModelAndView model = new ModelAndView();		
		//model.addObject("header-message", "attributeValue");
		model.setViewName("welcome");
		model.addObject("items", str);
		//session.setAttribute("user", null);
		//session.invalidate();
		return model;
	}
	
}
